<link rel="stylesheet" href="../addons/jy_creditshop/resource/css/common.css?v=1" />
<div class='fui-page fui-page-current'>
	<div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
			<a class="back"></a>
		</div>		
		<div class="title" id="chooseCate">
			<span ng-if="!pagedata.cate">全部商品</span>
			<span ng-if="pagedata.cate">{{pagedata.cate.name}}</span>
			<i class="icon icon-moreunfold" style="vertical-align: middle"></i>
		</div>
		<div class="fui-header-right"></div>
	</div>
	<style>
		.fui-navbar ~ .fui-content, .fui-content.navbar{padding:0;}
		.category {
			height: auto; width: 7rem; background: #fff; position: relative; top: 2rem; left: 0; z-index: 11; margin: auto; border-radius: 0.2rem; border: 1px solid #eee;
			padding: 0.1rem;
			max-height: 10rem;
			display: none;
			box-shadow: 0 0 6px 2px rgba(0,0,0,.04);
		}
		.category .inner {
			padding: 0 0.4rem;
			max-height: 9.6rem;
			overflow-y: auto;
			-webkit-overflow-scrolling: touch;
		}
		.category:before {
			content: '';
			position: absolute;
			top: -0.3rem;
			left: 50%;
			margin-left: -0.25rem;
			height: 0.5rem;
			width: 0.5rem;
			background: #fff;
			border-top: 1px solid #eee;
			border-left: 1px solid #eee;
			transform:rotate(45deg);
			-ms-transform:rotate(45deg);
			-moz-transform:rotate(45deg);
			-webkit-transform:rotate(45deg);
			-o-transform:rotate(45deg);
		}
		.category nav {
			font-size: 0.7rem;
			line-height: 1.6rem;
			position: relative;
			overflow: hidden;
		}
		.category nav:before {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			content: '';
			border-top: 1px solid #eee;
		}
		.category nav:first-child:before {
			border: 0;
		}
	</style>
	<div class="category">
		<div class="inner">
		
			<nav ng-repeat="item in pagedata.category"><a href="javascript:;" ng-click="access_json('jy_credit4shop/goods4/main/cateid='+item.id)" class="external">{{item.name}}</a></nav>
			
			<nav><a href="javascript:;" ng-click="access_json('jy_credit4shop/goods_detail/main/')" class="external">全部商品</a></nav>
		</div>
	</div>

	<div class='fui-content navbar'>
		<div class="fui-searchbar">
			<div class="searchbar" style="background:none">
				<a class="searchbar-cancel" id="search">搜索</a>
				<div class="search-input">
					<i class="icon icon-search"></i>
					<input type="search" id="keywords" placeholder="输入关键字..." value="{{pagedata.keywords}}">
				</div>
			</div>
		</div>

		<div class="fui-message fui-message-popup in content-empty" style="display: none; margin: 0; padding: 0; position: relative;">
			<div class="icon ">
				<i class="icon icon-information"></i>
			</div>
			<div class="content">未找到任何产品~</div>
		</div>

		<div class="fui-goods-group block border container" style="margin-bottom:2.5rem">
		<a ng-repeat="item in pagedata.list" href="javascript:;" ng-click="access_json('jy_credit4shop/goods_detail/main/id='+item.id)" data-nocache="false">
			<div class="fui-goods-item">
				<div class="image" style="background-image: url('{{tomedia(item.thumb)}}')"></div>
				<div class="detail">
					<div class="name">
						 <span ng-if="item.goodstype==0" class="fui-subtext">商品</span>
                        <span ng-if="item.goodstype==1" class="fui-subtext">优惠券</span>
                        <span ng-if="item.goodstype==2" class="fui-subtext">余额</span>
                        <span ng-if="item.goodstype==3" class="fui-subtext">红包</span>  
					
						<span ng-if="item.subtitle !=''" class="fui-label fui-label-danger">{{item.subtitle}}</span>
						
						{{item.title}}
					</div>
					<div class="price" style="display: block;">
						<span style="font-size: 0.5rem">
							<span style="font-size: 0.8rem; padding-right: 0.1rem;font-weight: bold;">{{item.credit}}</span>
							<span style="color:#999;">{{item.credit_title ||'积分'}}</span>
							   <span ng-if="item.money>0" style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">+ &yen;{{item.money}}</span>
						</span>
						<span ng-if="item.type==1" class="fui-text text-danger2" style="float:right;">抽奖</span>
						<span ng-if="item.type==0" class="fui-text text-danger2" style="float:right;">兑换</span>
					</div>
				</div>
			</div>
		</a>
		</div>
		<div ng-if="loading" class='infinite-loading' style="text-align: center; color: #666;">
			<span class='fui-preloader'></span>
			<span class='text'> 正在加载...</span>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.tool.get_list('jy_credit4shop/goods4/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_credit4shop/goods4/getlist/');
}
</script>